package cn.fzkj.common;

/** 封装所有的返回消息. */
public enum ResultCode {
    FAILUER(0,"FAILUER","请求失败"),
    SUCCESS(1,"SUCCESS","请求成功"),
    /** 300 - 399 参数错误*/
    PARAM_ERROR(300,"PARAM_ERROR","参数错误"),

    /** 200 - 299 其他错误*/

    /** 400 - 499 资源错误 */
    ACCESS_FORBIDDEN(403,"ACCESS_FORBIDDEN","权限不足"),
    RESOURCE_NOT_FOUND(404,"RESOURCE_NOT_FOUND","请求资源不存在"),

    /** 500 - 599 服务器错误 */
    SYSTEM_ERROR(500,"SYSTEM_ERROR","系统错误"),
    PYTHON_ERROR(501,"PYTHON_ERROR","python脚本调用错误"),

    /** 1 - 99  请求成功的具体返回 */
    LOGOUT(1,"LOGOUT","退出成功"),

    /** 100 - 199 请求失败的具体返回 */
    CODE_ERROR(100, "CODE_ERROR","验证码错误"),
    CODE_EXPIRE(101,"CODE_EXPIRE","验证码已失效")

    ;

    private Integer code;
    private String msg;
    private String extraMsg;

    ResultCode(Integer code, String msg, String extraMsg){
        this.code = code;
        this.msg = msg;
        this.extraMsg = extraMsg;
    }

    public Integer getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
    public String getExtraMsg() {
        return extraMsg;
    }
}
